package com.jhws.business.im.service;

import com.jhws.core.db.BaseDao;
import com.jhws.business.im.bo.IMOfflineMsg;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class IMService {
    @Resource
    private BaseDao BaseDao;

    /**
     * 保存离线的SIP消息
     * @param msg
     */
    public void saveSipOfflineMsg(IMOfflineMsg msg){
        Long timeStamp = System.currentTimeMillis();
        msg.setTimeStamp(timeStamp);
        BaseDao.saveOrUpdate(msg);	}

    public List<IMOfflineMsg> findInstantMsgByWhere(String where){
        return BaseDao.findList("from OfflineMsg "+where);
    }
}
